<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Activity extends Site_Controller {
	
	private $rice_export = 1;
	private $exhibition = 2;

	public function __construct(){
		parent::__construct();
	}

	public function index(  )
	{
		$this->rice_export();
	}
	
	public function rice_export(){
        $config['base_url'] = base_url() . 'content/activity/rice_export/';
        $config['total_rows'] = $this->mod_activity->getActivityNum($this->rice_export);
		$config['uri_segment'] = 4;
        $config['per_page'] = 16;

        $this->pagination->initialize($config);
		$data['data'] = $this->mod_activity->getActivity($this->uri->segment(4), $config['per_page'], $this->rice_export);
				
		$data['title']	= 'Rice Export Activities';
		$data['page']	= 'content/activity/view';
		$data['action']	= 'Activities';
		$this->load->view('layout/layout',$data);
	}
	
	public function exhibition(){
        $config['base_url'] = base_url() . 'content/activity/rice_export/';
        $config['total_rows'] = $this->mod_activity->getActivityNum($this->exhibition);
		$config['uri_segment'] = 4;
        $config['per_page'] = 16;

        $this->pagination->initialize($config);
		$data['data'] = $this->mod_activity->getActivity($this->uri->segment(4), $config['per_page'], $this->exhibition);
		
		
		$data['title']	= 'Exhibition Acitivities';
		$data['page']	= 'content/activity/view';
		$data['action']	= 'Activities';
		$this->load->view('layout/layout',$data);
	}
	
	public function detail(){
		$id = $this->uri->segment(4);
		$row = $this->mod_activity->getActivityById($id);
		$data['row'] = $row;
		
		$data['title']	= 'Detail Acitivities';
		$data['page']	= 'content/activity/detail';
		$data['action']	= $row[field('title')];
		$this->load->view('layout/layout',$data);
	}
}